#pragma once

class CMyNetwork
{
public:
	CMyNetwork(void);
	~CMyNetwork(void);

public:
	void Init(HWND hWnd);
	int Init(void* pController, TCHAR* pszIp, UINT port);
	void Close();
	
	int Send(char* pszData, UINT len);
	void Run();
	void ReceiveData();

	void Login(LPCTSTR lpszUserName, LPCTSTR lpszPassword);

public:
	bool IsConnected();
//	bool IsInited();

private:
	char m_szIP[17];
	UINT m_nPort;
	SOCKET s_server;
	void *m_pController;
	HANDLE m_hThread;

};
